﻿(function () {
    'use strict';
    var app = angular.module('app');

    app.controller("personSearchCtrl", ["$scope", "personService", function($scope, personService) {
        $scope.filter = {};
        $scope.search = function() {
            $scope.persons = [];
            personService.search($scope.filter, "a").then(function (result) {
                $scope.persons = result;
            });
        };

        $scope.clear = function() {
            $scope.filter = {};
            $scope.persons = [];
        };
        

    }]);

}());
